In order to realize a high-speed operation of an electronic apparatus, a semiconductor device included in the electronic apparatus has been miniaturized. One of the technologies for miniaturizing the semiconductor device is a fin field-effect transistor in which gates are formed on fins protruding from a substrate and the fins are used as three-dimensional channels.